// Copyright 2023 Srhino Co., Ltd. All rights reserved.

package core

import v3 "git.ouryun.cn/lzj1/grpc-bidirectional-stream/pkg/apis/v3"

type CallbackFunc func(message *v3.StreamMessage)

type Config interface {
	isConfig()
	GetAddress() string
	GetComponentName() string
	GetEngineSN() string
	GetCallback() CallbackFunc
}

type ClientConfig struct {
	// 服务端地址
	Address string
	// 组件名称
	ComponentName string
	// 引擎标识
	EngineSN string
	// 回调函数
	Callback CallbackFunc
}

func (c *ClientConfig) GetAddress() string {
	return c.Address
}

func (c *ClientConfig) GetComponentName() string {
	return c.ComponentName
}

func (c *ClientConfig) GetEngineSN() string {
	return c.EngineSN
}

func (c *ClientConfig) GetCallback() CallbackFunc {
	return c.Callback
}

func (c *ClientConfig) isConfig() {
	//TODO implement me
}

var _ Config = (*ClientConfig)(nil)

type ServerConfig struct {
	// 服务端地址
	Address string
}

func (s *ServerConfig) GetAddress() string {
	//TODO implement me
	panic("implement me")
}

func (s *ServerConfig) GetComponentName() string {
	//TODO implement me
	panic("implement me")
}

func (s *ServerConfig) GetEngineSN() string {
	//TODO implement me
	panic("implement me")
}

func (s *ServerConfig) GetCallback() CallbackFunc {
	//TODO implement me
	panic("implement me")
}

func (s *ServerConfig) isConfig() {
	//TODO implement me
}

var _ Config = (*ServerConfig)(nil)
